<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.w3.org/1999/xhtml">
<head>
    <th:block th:include="include :: header('房间类型新增')"/>
    <title></title>
    <style>
        /*.layui-form input[type=checkbox], .layui-form input[type=radio], .layui-form select {*/
        /*    display: block;*/
        /*}*/

        .select-style {
            width: 100%;
            padding-left: 10px;
            height: 38px;
            border-color: #e6e6e6;
            line-height: 1.3;
            line-height: 38px \9;
            border-width: 1px;
            border-style: solid;
            background-color: #fff;
            border-radius: 2px;
        }
    </style>
</head>
<body style="padding: 15px;">

<form class="layui-form" id="form"  action="#" >
    <div class="layui-form-item">
        <label class="layui-form-label">房间类型名</label>
        <div class="layui-input-block">
            <input type="text" name="roomTypeName" maxlength="10" required lay-verify="required" placeholder="请输入房间类型名" autocomplete="off"
                   class="layui-input">
        </div>
    </div>
    <div class="layui-form-item">
        <div class="layui-input-block">
            <button class="layui-btn" style="width: 80%" type="button" onclick="save()">立即提交</button>
        </div>
    </div>
</form>
<th:block th:include="include :: footer"/>
<script>

    function save(t){
        $.post(ctxPath+'/admin/roomType/saveOrUpdate',$("form").serialize(),function (rea) {
            if(rea.code === 200){
                var index = layer.open();
                window.parent.location.reload(); //刷新父页面
            }
            layui.use('layer', function(){
                var layer = layui.layer;
                layer.msg(rea.msg);
            });
        });

    }
    layui.use('form', function(){
        var form = layui.form;
        return false;
    });

</script>
</body>
</html>
